From: Konrad Rzeszutek Wilk Date: Wed, 21 Sep 2016 12:53:38 +0000 (-0400) Subject: xen-livepatch: Print the header _after_ the first livepatch hypercall X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~351 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success/%22http:/www.example.com/cgi/success?a=commitdiff_plain;h=a75f34462612a05547fc43d192705a9c31cad7fb;p=xen.git xen-livepatch: Print the header _after_ the first livepatch hypercall That way we can print out the header if we are sure the hypervisor has been compiled with Xen Livepatching. Reviewed-by: Ross Lagerwall Signed-off-by: Konrad Rzeszutek Wilk --- diff --git a/tools/misc/xen-livepatch.c b/tools/misc/xen-livepatch.c index 7512a98d23..2de04c0a16 100644 --- a/tools/misc/xen-livepatch.c +++ b/tools/misc/xen-livepatch.c @@ -91,8 +91,6 @@ static int list_func(int argc, char *argv[]) return rc; } - fprintf(stdout," ID | status\n" - "----------------------------------------+------------\n"); do { done = 0; /* The memset is done to catch errors. */ @@ -106,6 +104,10 @@ static int list_func(int argc, char *argv[]) idx, left, errno, strerror(errno)); break; } + if ( !idx ) + fprintf(stdout," ID | status\n" + "----------------------------------------+------------\n"); + for ( i = 0; i < done; i++ ) { unsigned int j;